home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-09-14 | 394 b | 22 lines | [TEXT/MPS ] |
- /* This is test.g which tests a simple DLG-based scanner, but with
- * a main() in another file.
- */
-
- <<
- typedef ANTLRCommonToken ANTLRToken;
- >>
-
- #token "[\ \t\n]+" <<skip();>>
- #token Eof "@"
-
- class Expr { /* Define a grammar class */
-
- e : IDENTIFIER NUMBER Eof
- <<fprintf(stderr, "text is %s,%s\n", $1->getText(), $2->getText());>>
- ;
-
- }
-
- #token IDENTIFIER "[a-z]+"
- #token NUMBER "[0-9]+"
-